﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace eCitizen.DataContracts
{
    public class SftpConfiguration
    {

        private string _oneSmsFolderUrl;
        public string RootDirectoryUrl { get; set; }
        public string ArchieveFolderUrl { get; set; }
        public string Agency { get; set; }
        public string Service { get; set; }
        public string InboxUrl { get; set; }
        public string OutboxUrl { get; set; }

        public string OneSmsFolderUrl
        {
            get { return _oneSmsFolderUrl; }
            set { _oneSmsFolderUrl = value; }
        }


        #region "Local Working Folder"
        
        public string GetLocalInboxFolder()
        {
            return string.Format("{0}\\{1}\\{2}\\{3}", RootDirectoryUrl, Agency, Service, InboxUrl);
        }
        public string GetLocalOutboxFolder()
        {
            return string.Format("{0}\\{1}\\{2}\\{3}", RootDirectoryUrl, Agency, Service, OutboxUrl);
        }

        public string GetLocalSmsInboxFolder()
        {
            return string.Format("{0}\\{1}\\{2}\\{3}\\{4}",RootDirectoryUrl, OneSmsFolderUrl, Agency, Service, InboxUrl);
        }
        public string GetLocalSmsOutboxFolder()
        {
            return string.Format("{0}\\{1}\\{2}\\{3}\\{4}", RootDirectoryUrl, OneSmsFolderUrl, Agency, Service, OutboxUrl);
        }

        #endregion
        #region "Archive Folder"

        public string GetLocalArchieveInboxFolder()
        {
            return string.Format("{0}\\{1}\\{2}\\{3}\\{4}", RootDirectoryUrl, ArchieveFolderUrl, Agency, Service, InboxUrl);
        }
        public string GetLocalArchieveOutboxFolder()
        {
            return string.Format("{0}\\{1}\\{2}\\{3}\\{4}", RootDirectoryUrl, ArchieveFolderUrl, Agency, Service, OutboxUrl);
        }

        public string GetLocalSmsArchieveInboxFolder()
        {
            return string.Format("{0}\\{1}\\{2}\\{3}\\{4}\\{5}", RootDirectoryUrl, ArchieveFolderUrl, OneSmsFolderUrl, Agency, Service, InboxUrl);
        }
        public string GetLocalSmsArchieveOutboxFolder()
        {
            return string.Format("{0}\\{1}\\{2}\\{3}\\{4}\\{5}", RootDirectoryUrl, ArchieveFolderUrl, OneSmsFolderUrl, Agency, Service, OutboxUrl);
        }

        #endregion


        #region "Server Folder"
        
        public string GetServerInboxFolder()
        {
            return String.Format("{0}/{1}/{2}", Agency, Service, InboxUrl);
        }
        public string GetServerOutboxFolder()
        {
            return String.Format("{0}/{1}/{2}", Agency, Service, OutboxUrl);
        }

        #endregion

    }
}
